<%@ page import="com.itheima.domain.Student" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/9/21
  Time: 20:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>查询</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/allCss.css">
</head>
<body>
    <div id="search">
        <br/>
        <h1>学生信息</h1>
    <table width="80%" border="1px">
        <tr>
            <th>学生姓名</th>
            <th>学生年龄</th>
            <th>学生成绩</th>
        </tr>
        <%
            //遍历集合
            ArrayList<Student> students = (ArrayList<Student>) session.getAttribute("students");
            for(Student stu : students) {
        %>
        <%--将集合里的学生对象的属性存到表格中--%>
        <tr align="center">
            <td><%=stu.getName()%></td>
            <td><%=stu.getAge()%></td>
            <td><%=stu.getScore()%></td>
        </tr>
        <%}%>
    </table>
        <br/>
        <br/>
    </div>
</body>
</html>
